Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling USE_UNIX_SOCKETS does not remove the use of AF_UNIX when compiling libcurl. #13620

Closed
b5i opened this issue May 13, 2024 · 5 comments
Closed
Labels

Comments

@b5i
Copy link
Contributor

b5i commented May 13, 2024

I did this

I tried to compile Curl using the curl_config.h in attachement
curl_config.h.zip and with the BUILDING_LIBCURL and HAVE_CONFIG_H enabled. Changing AF_UNIX to AF_INET in src/socketpair.h when defining wakeup_create(p) does the trick and libcurl builds successfully.

I expected the following

The curl_config.h file contains //#define USE_UNIX_SOCKETS 1 because ESP32 with FreeRTOS and the xtensa-esp32-elf toolchain don't support them. Therefore, AF_UNIX shouldn't be used when compiling libcurl as it would be undefined (error: /src/socketpair.h:41:42: error: 'AF_UNIX' undeclared (first use in this function); did you mean 'AF_INET'?). Would changing it to AF_INET when USE_UNIX_SOCKETS = 0 be a good workaround?

curl/libcurl version

curl 8.8.0-DEV

operating system

Darwin MBP-de-Antoine 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:37 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6031 arm64, compiling with toolchain-xtensa-esp32@8.4.0+2021r2-patch5/xtensa-esp32-elf from PlatformIO.

@bagder bagder added the build label May 13, 2024
@bagder
Copy link
Member

bagder commented May 13, 2024

Does it actually still work then? Or is your build using the Curl_socketpair() "emulation" function?

@b5i
Copy link
Contributor Author

b5i commented May 13, 2024

Does it actually still work then?

Do you mean if libcurl builds? In that case yes when changing AF_UNIX to AF_INET.
If you meant whether curl actually works when built that's what I'm testing right now with a simple project to make sure it's not broken.

Or is your build using the Curl_socketpair() "emulation" function?

I guess so as HAVE_SOCKETPAIR is not defined in my curl_config.h.

@b5i
Copy link
Contributor Author

b5i commented May 14, 2024

I can confirm that I'm able to do POST and GET requests on a physical ESP32 when compiling with the workaround.

@bagder
Copy link
Member

bagder commented May 15, 2024

Are you up for providing it as a PR?

@bagder
Copy link
Member

bagder commented May 16, 2024

Fixed in #13666

@bagder bagder closed this as completed May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants